package com.itheima.user.sentinel.fallback;

import com.alibaba.fastjson.JSON;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.HashMap;
import java.util.Map;

/**
 * @Description:
 * @Version: V1.0
 */
@Component
public class UserControllerFallback {


    public static String hello7Fallback(@RequestParam("flag") int flag, Throwable te) {
        te.printStackTrace();

        Map map = new HashMap();
        map.put("code", 429);
        map.put("message", "网络异常，请稍后尝试 UserControllerFallback");

        return JSON.toJSONString(map);
    }

}
